#include <stdio.h>
#include <malloc.h>
#include <unistd.h>
#include <string.h>

int g_unval;
int g_val = 100;

int main(int argc , char* argv[] , char* envp[]) {
  printf("code addr: %p\n" , main);
  char* str = "hello world!";
  printf("read only addr: %p\n" , str);
  printf("init addr: %p\n" , &g_val);
  printf("uninit addr: %p\n" , &g_unval);
  int* p = (int*)malloc(10);
  printf("heap aadr: %p\n" , p);
  printf("stack addr: %p\n" , &p);
  
  for (int i = 0 ; i < argc ; i ++) {
    printf("args addr: %p\n" , argv[i]);
  }









  /*int i = 0;
  while (envp[i] != NULL) {
      printf("envp[%d]: %s\n" , i , envp[i]);
      i ++;
  }
  
  if (strcmp(argv[1] , "-a") == 0) {
      printf("hello bit!\n");
  }

  else if (strcmp(argv[1] , "-b") == 0) {
    printf("hello world!\n");
  }
  for (int i = 0 ; i < argc ; i ++) {
      printf("argv[%d]: %s\n" , i , argv[i]);
  }
  while (1) {
      printf("hello bit!\n");
      sleep(1);
  }*/ 
    return 0;
}
